package com.sphd.Restaurant.presenter;



import android.content.Context;

import com.sphd.Restaurant.base.MyApplication;
import com.sphd.Restaurant.interfFace.VolleyCallBack;
import com.sphd.Restaurant.model.BaseModel;
import com.sphd.Restaurant.utils.MyJson;

import java.util.Map;

/**
 * Created by Hu on 2016/9/28.
 */

public abstract class BasePresenter {
    BaseModel baseModel;
   public Context context= MyApplication.getContext();
    public MyJson myJson = new MyJson();

    public void sendStringUrl(String url, VolleyCallBack volleyCallBack) {
        if (baseModel == null)
            baseModel = new BaseModel();
        baseModel.sendStringUrl(url, volleyCallBack);
    }

    public void sendStringUrl(String url, VolleyCallBack volleyCallBack, Map<String, String> map) {
        if (baseModel == null)
            baseModel = new BaseModel();
        baseModel.sendStringUrl(url, volleyCallBack, map);
    }

    public void sendJsonObjectUrl(String url, VolleyCallBack volleyCallBack, Map<String, String> map) {
        if (baseModel == null)
            baseModel = new BaseModel();
        baseModel.sendJsonObjectUrl(url, volleyCallBack, map);
    }

    public void sendJsonObjectUrl(String url, VolleyCallBack volleyCallBack) {
        if (baseModel == null)
            baseModel = new BaseModel();
        baseModel.sendJsonObjectUrl(url, volleyCallBack);
    }

    public void sendJsonArrayUrl(String url, VolleyCallBack volleyCallBack) {
        if (baseModel == null)
            baseModel = new BaseModel();
        baseModel.sendJsonArrayUrl(url, volleyCallBack);
    }

    public void sendJsonArrayUrl(String url, VolleyCallBack volleyCallBack, Map<String, String> map) {
        if (baseModel == null)
            baseModel = new BaseModel();
        baseModel.sendJsonArrayUrl(url, volleyCallBack, map);
    }

    public abstract void addData(String url);

}
